home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
PPC1B3AA.ZIP
/
MENU.PPS
< prev
next >
Wrap
Text File
|
1996-08-29
|
2KB
|
87 lines
;----------------------------------------------------------------------------
; Copyright(C) 1996, The AEGiS Corporation
;----------------------------------------------------------------------------
;
; FUNCTION Menu()
;
; Full featured lightbar menu function!
; Returns the item selected
;
;----------------------------------------------------------------------------
#lib
#nouser
Declare Function Menu(String PageName, Int FirstLine, Int nLines, Int DefaultLine) Integer
Declare Procedure Menu_DispSelected(Integer Seln)
Declare Procedure Menu_RemoveSelected(Integer Seln)
Declare Procedure Menu_RemCursor()
String Menu_Key, Menu_BackupLightbar
Int Menu_FirstLine
;----------------------------------------------------------------------------
Function Menu(String PageName, Int Firstline, Int nLines, Int DefaultLine) Integer
Int Sel
Sel = DefaultLine
Menu_FirstLine = FirstLine
Color @X0F
Cls
StartDisp FNS
DispFile PPEPath() + PageName, Graph + Lang
Menu_DispSelected(Sel)
While (1) Do
Menu_Key = Inkey()
If (Menu_Key <> "") Then
Select case Menu_Key
Case "DOWN", "2","5"
Menu_RemoveSelected(Sel)
Sel = Sel + 1
If (Sel = nLines + 1) Sel = 1
Menu_DispSelected(Sel)
Case "UP","8"
Menu_RemoveSelected(Sel)
Sel = Sel - 1
If (Sel = 0) Sel = nLines
Menu_DispSelected(Sel)
Case Chr(13)
Menu = Sel
Break
Case Chr(27)
Menu = 0
Break
End Select
EndIf
EndWhile
Endfunc
;----------------------------------------------------------------------------
Procedure Menu_DispSelected(Integer Seln)
AnsiPos 22,Menu_FirstLine+Seln-1
Menu_BackupLightbar = ScrText(22,Menu_FirstLine+Seln-1,36,True)
Print "@X1F",ScrText(22,Menu_FirstLine+Seln-1,36,False)
Menu_RemCursor()
Endproc
;----------------------------------------------------------------------------
Procedure Menu_RemoveSelected(Integer Seln)
AnsiPos 22,Menu_FirstLine+Seln-1
Print "@X0F",Menu_BackupLightbar
Menu_RemCursor()
Endproc
;----------------------------------------------------------------------------
Procedure Menu_RemCursor()
AnsiPos 1,22
Color 0
Print " "
Backup 1
EndProc